import React from 'react';
import classNames from 'classnames';
import Icon from 'shared/components/base/Icon';
import './index.less';

export default class SecondMenu extends React.PureComponent {
  render() {
    const { data=[], show, onClose, onItemClick } = this.props;
    return (
      <div className={classNames("second-menu",{ hidden: !show })}>
        <div className="second-menu-close">
          <span onClick={onClose}><Icon type="close" /></span>
        </div>
        <ul>
          {
            data.map((item, index) => (
              <li
                key={index}
                className="second-menu-list-item"
                onClick={()=> { onItemClick(item) }}
              >
                <span className="second-menu-list-item-title">{item.title}</span>
              </li>
            ))
          }
        </ul>
      </div>
    );
  }
}